<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:composite="http://java.sun.com/jsf/composite">
    <composite:interface>
        <composite:attribute name="modelIdParamName" type="java.lang.String"/>        
        <composite:attribute name="modelId" type="java.lang.String"/>

        <composite:attribute name="parentIdParamName" type="java.lang.String"/>
        <composite:attribute name="parentId" type="java.lang.String"/>

        <composite:attribute name="deleteListener" required="true" method-signature="void delete(javax.faces.event.ActionEvent)"/>

        <composite:attribute name="outcomeDetail" type="java.lang.String"/>
        <composite:attribute name="outcomeEdit" type="java.lang.String"/>

        <composite:attribute name="msgDelete"/>
        <composite:attribute name="msgConfirm"/>
        <composite:attribute name="msgEdit"/>
        <composite:attribute name="msgDetail"/>
    </composite:interface>

    <composite:implementation>
        <c:set var="msgDelete" value="#{cc.attrs.msgDelete}"/>
        <c:if test="#{empty cc.attrs.msgDelete}">
            <c:set var="msgDelete" value="#{deltasetMessages['deltaset.crud.delete']}"/>
        </c:if>
        <c:set var="msgConfirm" value="#{cc.attrs.msgConfirm}"/>
        <c:if test="#{empty cc.attrs.msgConfirm}">
            <c:set var="msgConfirm" value="#{deltasetMessages['deltaset.confirm.question']}"/>
        </c:if>
        <c:set var="msgEdit" value="#{cc.attrs.msgEdit}"/>
        <c:if test="#{empty cc.attrs.msgEdit}">
            <c:set var="msgEdit" value="#{deltasetMessages['deltaset.crud.edit']}"/>
        </c:if>
        <c:set var="msgDetail" value="#{cc.attrs.msgDetail}"/>
        <c:if test="#{empty cc.attrs.msgDetail}">
            <c:set var="msgDetail" value="#{deltasetMessages['deltaset.crud.view']}"/>
        </c:if>
        <h:commandButton id="deleteButton"
                         styleClass="ds-grid-crud-action ds-float-right ui-icon ui-icon-close"
                         onmouseup="this.blur()"                         
                         title="#{msgDelete}"
                         value="#{msgDelete}"
                         onclick="return deltaset.confirm(this,'#{msgConfirm}')"
                         actionListener="#{cc.attrs.deleteListener}">
            <f:param name="#{cc.attrs.modelIdParamName}" value="#{cc.attrs.modelId}" />
            <c:if test="#{! empty cc.attrs.parentIdParamName}">
                <f:param name="#{cc.attrs.parentIdParamName}" value="#{cc.attrs.parentId}"/>
            </c:if>
        </h:commandButton>
        <h:outputText value=" "/>
        <h:button outcome="#{cc.attrs.outcomeEdit}" onclick="window.location=this.href"
                  styleClass="ds-grid-crud-action ds-float-right ui-icon ui-icon-pencil"
                  onmouseup="this.blur()"                  
                  title="#{msgEdit}"
                  value="#{msgEdit}">
            <f:param name="#{cc.attrs.modelIdParamName}" value="#{cc.attrs.modelId}"/>
            <c:if test="#{! empty cc.attrs.parentIdParamName}">
                <f:param name="#{cc.attrs.parentIdParamName}" value="#{cc.attrs.parentId}"/>
            </c:if>
        </h:button>
        <h:outputText value=" "/>
        <h:button outcome="#{cc.attrs.outcomeDetail}" onclick="window.location=this.href"
                  styleClass="ds-grid-crud-action ds-float-right ui-icon ui-icon-search"
                  onmouseup="this.blur()"
                  value="#{msgDetail}"
                  title="#{msgDetail}">
            <f:param name="#{cc.attrs.modelIdParamName}" value="#{cc.attrs.modelId}"/>
            <c:if test="#{! empty cc.attrs.parentIdParamName}">
                <f:param name="#{cc.attrs.parentIdParamName}" value="#{cc.attrs.parentId}"/>
            </c:if>
        </h:button>
    </composite:implementation>
</ui:composition>